import request from "@/utils/request"

//发送请假数据
export function createleave(data){
    return request({
        url:'/leave/in-records/create',
        method:'post',
        data
        
    })
}

// 得到教师
export function getteacherPage(params) {
    return request({
        url: 'teachers/T_teachers/page',
        method: 'get',
        params
    })
}

// 更改请假
export function updateleave(data){
    return request({
        url:'/leave/in-records/update',
        method:'put',
        data:data
    })
}

// 获取状态码【0-审核中】
export function getstatusZero(){
    return request({
        url:'/leave/in-records/getZero',
        method:'get'
    })
}

// 获取状态码【1-已通过】
export function getstatusOne() {
    return request({
        url: '/leave/in-records/getOneAndTwo',
        method: 'get'
    })
}

//删除数据
export function deleteleave(id) {
    return request({
      url: '/leave/in-records/delete?id=' + id,
      method: 'delete'
    })
  }
//获得状态码草稿箱
export function getstatusDraft() {
    return request({
        url: '/leave/in-records/getDraft',
        method: 'get'
    })
}
export function statusDraft({id}){
    return request({
        url: '/leave/in-records/updateDraft',
        method: 'put',
       params:{id}
    })
}
//存为草稿箱
export function saveDraft(data){
    return request({
        url:'/leave/in-records/createDraft',
        method:'post',
        data
    })
}
//撤销
export function cancel({id}){
    return request({
        url:'/leave/in-records/updateApproval',
        method:'put',
        params:{id}
    })
}
//获得驳回原因
export function getReason(params){
    return request({
        url:'/leave/in-records/getReason',
        method:'get',
        params
    })
}